function map(width, height) {
	this.width = width;
	this.height = height;
	this.tileSize = 32;
	this.pixelWidth = this.width * this.tileSize;
	this.pixelHeight = this.height * this.tileSize;

	this.tiles = [];

	for(var x = 0; x < width; x++) {
		this.tiles[x] = [];
		for(var y = 0; y < height; y++) {
			this.tiles[x][y] = new tile(x, y);
		}
	}
}

map.prototype.tileInBounds = function(tileX, tileY) {
	return tileX >= 0 && tileY >= 0 && tileX < this.width && tileY < this.height;
}

map.prototype.pixelInBounds = function(pixelX, pixelY) {
	return pixelX >= 0 && pixelY >= 0 && pixelX < this.width * this.tileSize && pixelY < this.height * this.tileSize;
}
